function [ts]=whitenoise(N,a,sc)
% whitenoise(N,a,sc)
% 	Parameters:
% 		N:	number of data points to include in resulting time series
% 		a: 	type of noise to generate ('w' = white noise, 'r' = 1/f noise, 'b' = f noise)
% 		sc: 	coefficient to scale noise by
% 	Outputs:
% 		ts	the desired time series
% 	Purpose of this code:  This code will produce a time seriese of noise of a given length and type.

   
if a == 'w' ts = (randn(1,N))*sc; end
if a == 'r' ts = cumsum(randn(1,N))*sc; end
if a == 'b' ts = diff(randn(1,N))*sc; ts(N) = randn(1,1);end

end

